package cn.copera.dyy.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.copera.dyy.common.service.BaseService;
import cn.copera.dyy.dao.UserDao;
import cn.copera.dyy.entity.User;

/**
 * 客户Service
 * 
 */
@Service
@Transactional(readOnly = true)
public class UserService extends BaseService {

	@Autowired
	private UserDao userDao;

	@Transactional(readOnly = false)
	public void save(User user) {
		userDao.clear();
		userDao.save(user);
	}
	public User findUserByNickName(String nickName){
		return userDao.findExistEntity(new User(), "nickName='"+nickName+"'");
	}
	
}
